﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace JT.Domain
{
    public class Summary
    {
        public Summary()
        {
            GeneralLedgers = new HashSet<GeneralLedger>();
        }

        [Display(Name = "凭证编号")]
        public int Id { get; set; }

        [Display(Name = "摘要")]
        [Required(ErrorMessage = "摘要不能为空!")]
        public string SummaryName { get; set; }

        [Display(Name = "填表人")]
        [Required(ErrorMessage = "填表人不能为空!")]
        public string Preparer { get; set; }

        [Display(Name = "记账日期")]
        [Required(ErrorMessage = "记账日期不能为空!")]
        [DataType(DataType.Date)]
        //[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        public DateTime DebitDate { get; set; }

        [DisplayName("借方金额合计")]
        public double? TotalDebitAmount { get; set; }

        [DisplayName("贷方金额合计")]
        public double? TotalCreditAmount { get; set; }

        [DisplayName("摘要合计")]
        public double? TotalSummary { get; set; }

        public ICollection<GeneralLedger> GeneralLedgers { get; set; }

    }
}
